<template>
  <div>
    <div class="son1">
      <h1>我是子组件MySon1</h1>
      <button @click="clickHandler">我给父组件送一辆法拉利</button>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  methods: {
    //按钮的点击事件的回调
    clickHandler() {
      //事件源触发自定义事件car
      this.$emit("car", "法拉利");
    },
  },
};
</script>

<style scoped>
div.son1{
  width: 400px;
  height: 200px;
  background: hotpink;
  margin: 50px;
}
</style>
